﻿namespace ED.Common.BaseModel
{
    /// <summary>
    /// 统一请求基类
    /// </summary>

    public class BaseReq
    {

    }
    /// <summary>
    /// 分页请求基类
    /// </summary>
    public class BaseReqPage : BaseReq
    {
        /// <summary>
        /// 默认页码
        /// </summary> 
        private int pageIndex = 1;

        /// <summary>
        /// 默认页数
        /// </summary>
        private int pageSize = 10;

        /// <summary>
        /// 当前页码
        /// </summary>
        public int PageIndex
        {
            set
            {
                if (value <= 0)
                {
                    value = 1;
                }
                pageIndex = value;
            }
            get { return pageIndex; }
        }
        /// <summary>
        /// 页码条数
        /// </summary>
        public int PageSize
        {
            set
            {
                if (value <= 0)
                {
                    value = 10;
                }
                pageSize = value;
            }
            get
            {
                return pageSize;
            }
        }
    }
    /// <summary>
    /// 表示分页数据模型
    /// </summary>
    /// <typeparam name="T">数据模型</typeparam>
    /// <example>
    /// </example>
    public class PageOut<T>
    {
        /// <summary>
        /// 总数
        /// </summary>
        public long TotalCount { get; set; }

        /// <summary>
        /// 当前页数据
        /// </summary>
        public IList<T> List { get; set; }
    }
}
